package com.tianhao.luo.nouse.product;

import java.io.Serializable;
import java.util.Date;

/**
 * 会被Product类引用的类
 * @author tianhao.luo
 * @date 2019/12/13 15:05
 */
public class BaseInfo implements Cloneable, Serializable {
    private static final long serialVersionUID = 42L;
    private Date createTime;

    public BaseInfo(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return super.hashCode()+"  ]BaseInfo{" +
                "createTime=" + createTime +
                '}';
    }

    /**
     * 给引用类型提供可克隆的方法，该类的字段类型是java.util.Date，对不可变字段就是浅拷贝就行了)
     * @return BaseInfo对象
     * @throws CloneNotSupportedException 克隆异常
     */
    @Override
    public BaseInfo clone() throws CloneNotSupportedException {
        return ((BaseInfo) super.clone());
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
